// /**
//  * @author: Pegasus  Date: 2018/5/21 Time: 10:52
//  *
//  * 图片选择
//  */
//
import ImagePicker from 'react-native-image-crop-picker'


/**
 * 从相册选择 支持多选
 * @param callback 参数是选择的照片地址的回调函数 callback(path)
 */
export const imagePickerFromLibrary = callback => {
  ImagePicker.openPicker({
    multiple: false,
    mediaType: 'photo',
    loadingLabelText: '图片加载中...',
    compressImageQuality: 0.5,
    cropperCancelText: '取消',
    cropperChooseText: '确定',
    maxFiles: 5
  }).then(res => {
    callback(res)
  })
};

/**
 * 拍照选择 支持多选
 * @param callback 参数是选择的照片地址的回调函数 callback(path)
 */
export const imagePickerFromCamera = callback => {
  ImagePicker.openCamera({
    // multiple: true,
    mediaType: 'photo',
    loadingLabelText: '图片加载中...',
    compressImageQuality: 0.5,
    cropperCancelText: '取消',
    cropperChooseText: '确定'
  }).then(res => {
    callback(res)
  })
};
